package it.cst.entity.service;

import it.cst.entity.Player;
import it.cst.entity.dao.PlayerDAO;


import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

@Service
public class PlayerServiceImpl implements PlayerService{
	@Autowired
	private PlayerDAO playerDAO;
	
	
	public PlayerDAO getPlayerDAO() {
		return playerDAO;
	}

	public void setPlayerDAO(PlayerDAO playerDAO) {
		this.playerDAO = playerDAO;
	}

	@Transactional
	public void addPlayer(Player player) {
		playerDAO.addPlayer(player);
		
	}

	@Transactional
	public List<Player> listPlayer() {
		return playerDAO.listPlayer();
	}

	@Transactional
	public void removePlayer(Player player) {
		playerDAO.removePlayer(player);
	}

	@Override
	public Player getPlayer(Integer id) {
		// TODO Auto-generated method stub
		return null;
	}

	@Transactional
	public List<Player> listGroupPlayer(Integer idGroup) {
		return playerDAO.listGroupPlayer(idGroup);
	}

}
